import type {bannerItem, CategoryItem, HotItem, GuessItem} from '@/types/home'
import { http } from '@/utils/http'
import type {PageParams, PageResult} from "@/types/global";
/**
 * 首页广告区域
 * @returns
 */
export const getHomeBannerAPI = (distributionSite = 1) => {
  return http<bannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}

/**
 * 分类
 * @returns
 */
export const getHomeCategoryAPI = () => {
  return http<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}

export const getHomeHotAPI = () => {
  return http<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}

export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data
  })
}
